#ifndef __INPUT_MANAGER_H__
#define __INPUT_MANAGER_H__
#include <sys/time.h>
#include <pthread.h>
#include <linux/input.h>

#define INPUT_TYPE_STDIN 	0
#define INPUT_TYPE_TOUCH	1

#define INPUT_VALUE_UP		0
#define INPUT_VALUE_DOWN	1
#define INPUT_VALUE_EXIT	2
#define INPUT_VALUE_UNOKWN	-1

typedef struct inputEvent
{
	struct timeval time;
	int type;
	int value;
	int x;
	int y;
	int pressed;
}T_inputEvent, *PT_inputEvent;

typedef struct inputOpr
{
	char *name;
	pthread_t tid;
	int (*inputDeviceInit)(void);
	int (*inputDeviceExit)(void);
	int (*getInputEvent)(PT_inputEvent g_ptInputEvent);
	struct inputOpr *next;
}T_inputOpr, *PT_inputOpr;

int registerInputOpr(PT_inputOpr ptInputOpr);
void showInputOpr(void);
int initAllInputOpr(void);
int getInputEvent(PT_inputEvent ptInputEvent);
int inputInit(void);
int inputExit(void);

int stdinInit(void);
int touchInit(void);

#endif

